package com.aku.controller.api;

import com.aku.pojo.Book;
import com.aku.pojo.Student;
import com.aku.service.BookService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/api/admin")
public class ApiAdminController {

    @Resource
    private BookService bookService;

    @RequestMapping("/addBook")
    public String addStudent(Book book){
        bookService.addBook(book);
        return "redirect:/page/admin/adminBookInfo";
    }

    @RequestMapping("/addStudent")
    public String addStudent(){
        return "redirect:/page/admin/adminStuInfo";
    }

}
